package book;


public class Book {
    private String name;
    private String author;
    private double price;
    private String type;
    private boolean status;//借阅状态 默认FALSE未借出。
    private static int id=0;
    private int bookid=0;//图书id，每本图书唯一。

    public Book(String name, String author, double price, String type) {
        this.id+=1;
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
        this.bookid=this.id;
    }

    public String getName() {
        return name;
    }

    public void setBookid(int bookid) {
        this.bookid = bookid;
    }

    public static int getId() {
        return id;
    }

    public int getBookid() {
        return bookid;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookid:" + bookid +
                ", name:" + name +
                ", author:" + author +
                ", price:" + price +
                ", type:" + type +
                ", 借阅状态:" + (status ? "已借出" : "未借出") +
                '}';
    }
}
